home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
bbs
/
mxgui203.zip
/
MAXDOOR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-08-14
|
9KB
|
211 lines
{
───────────────────────────────────────────────────────────────────────────────
▀▀▀ ▀▀▀ ▀▀▀▀▀ ▀▀ ▀▀
▀▀▀▀ ▀▀▀▀ ▀▀ ▀▀ ▀▀ ▀▀
▀▀ ▀▀▀ ▀▀ ▀▀▀▀▀▀▀ ▀▀▀ ╔══ ╦═╗ ╔═╗ ╦═╗ ╦ ╦ ╦ ╔═╗ ╔═╗
▀▀ ▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ║ ╦ ╠╦╝ ╠═╣ ╠═╝ ╠═╣ ║ ║ ╚═╗
▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ╚═╝ ╩╚═ ╩ ╩ ╩ ╩ ╩ ╩ ╚═╝ ╚═╝
───────────────────────────────────────────────────────────────────────────────
The MAX Graphics GUI Kit is Copyright 1995-Current Larry L. Athey (LA-Soft).
Color Averaging procedures are courtesy of Sean Price (Rude Dog Software).
─────────────────────────────────────────────────────────────────────────────── }
{ Adjust your compiler directives as you see fit }
{$A+,B-,D+,E+,F+,G+,I-,L+,N-,O+,P-,Q-,R-,S-,T-,V+,X+}
PROGRAM MAXDOOR;
{USES CRT, TDK_VARS, MAX_UNIT, DOORKIT1, DOORKIT2, DOORKIT3;{
^ Use this for: No Local SVGA Graphics / With Comm Routines.}
USES GENOVR, CRT, TDK_VARS, DOORKIT2, MAXUNITG;{
^ Use this for: With Local SVGA Graphics / No Comm Routines.}
{$O GUI_ICON}
{$O GUI_IMAG}
{$O GUI_MOUS}
{$O GUI_UTIL}
{$O GUI_ANSI}
{$O MAXUNITG}
{$O DOORKIT1}
{$O DOORKIT2}
{$O DOORKIT3}
{$O ANSIUNIT}
{$O DIGIBORD}
{$O FOSUNIT}
{$O CRCUNIT}
{$O ASYNC}
{$O COMM}
{^ All of the above declarations are only temporary unit overlay
references. These units are only overlayed during the testing
of the door in local SVGA mode. When you compile your program
with the comm routines, remove these references by inserting
a period before the dollar sign...The only reason these units
are overlayed is to conserve memory during SVGA testing...}
{$I MAXDOOR.INC}
PROCEDURE DoorIntro;
BEGIN
RipToText;
InfoText(' About This Door Program ');
Set_Color(11,0); sWriteln(''); sWriteln('');
sWriteln('This is an example door program to demonstrate the ins and outs of writing a');
sWriteln('MAX door using TDK and The MAX Graphics GUI Kit...Through the use of The MAX');
sWriteln('Graphics GUI Kit, you can write the MAX side of your door in local SVGA mode');
sWriteln('thus eliminating the need to call in from remote with MAXterm to see how the');
sWriteln('program looks and operates in MAX mode...');
sWriteln('');
sWriteln('Before this program can be compiled to run in local SVGA mode, you will need');
sWriteln('a copy of The MAX Graphics GUI Kit, and the FastGraph or FastGraph/Light kit');
sWriteln('by Ted Gruber Software...BBS Utiliteez Software/LA-Soft/MAX Graphics and Ted');
sWriteln('Gruber Software/FastGraph are in no way connected. The FastGraph kit is only');
sWriteln('a development tool that MAX Graphics was designed around...');
sWriteln('');
sWriteln('This program is intentionally running in ANSI mode right now, mainly just to');
sWriteln('demonstrate this capability to the programmer. If the programmer so chooses,');
sWriteln('they may combine ANSI with MAX Graphics in the same program...However, since');
sWriteln('The MAX Graphics GUI Kit uses primarily "Dummy Routines", the programmer may');
sWriteln('need to copy source code from other TDK units to perform certain functions..');
sWriteln(''); AnyKey;
END;
PROCEDURE TextPortDemo;
VAR
Ch : CHAR;
C : BYTE;
PROCEDURE SendMessage(St : STRING);
BEGIN
sWriteln('');
OutTxt(10,0,St);
END;
BEGIN
C := 0;
PortDemo_Max;
SendMessage('This is a MAXterm Text_View_Port... ');
REPEAT
Ch := UPCASE(sReadKey);
IF Ch <> 'Q' THEN BEGIN
INC(C);
IF C = 6 THEN C := 0;
CASE C OF
0 : SendMessage('This is a MAXterm Text_View_Port... ');
1 : SendMessage('This allows you to use ANSI text in a ');
2 : SendMessage('SVGA door. So, if your door uses both ');
3 : SendMessage('ANSI and MAX, then you can cut down ');
4 : SendMessage('program overhead by sharing the same ');
5 : SendMessage('text procedures for both emulations. ');
END;
END;
UNTIL Ch = 'Q';
END;
PROCEDURE MainMenu;
VAR
C : BYTE;
Ch : CHAR;
St : STRING;
F : TEXT;
BEGIN
DoorIntro;
REPEAT
ShowScreen('MAINMENU.MAX'); {Refer to DOORKIT3.PAS }
Ch := UPCASE(sReadKey);
CASE Ch OF
'R' : ShowTextFile('MXGUI203.DOC'); {Refer to DOORKIT3.PAS }
{'R' : ShowTextFile('DOORKIT.DOC'); {Refer to DOORKIT3.PAS }
'E' : BEGIN
{This case procedure demonstrates how to use entry fields in MAX}
{Graphics...The entry fields are actually handled locally within}
{MAXterm, so you want to disable all inactivity timeout checking}
{only while the remote fields are active then re-enable checking}
{after the remote sends a character to indicate they are done...}
{Another thing to make a note of is that when using remote entry}
{fields is that the user must click a button with their mouse or}
{press an ALT keypress. This is the reason that the procedure in}
{the below looks for an ASCII #24 which is an ALT-O keypress. If}
{you look at FDemo_Max, the first button is assigned to ALT-O...}
FDemo_Max; {Internal MAX screen file, see the file MAXDOOR.INC }
DoorSys.UpdateIdle := FALSE; {Stop inactivity checking }
Ch := sReadKey;
DoorSys.UpdateIdle := TRUE; {Restart inactivity checking}
IF Ch = #24 THEN BEGIN {#24 = ALT-O for "Okay" }
MaxCommand(''); {Clear The Remote Buffer }
{MaxCommand('Get_Field_Data()');} {MAXscript Get_Field_Data }
MaxCommand(#255#126#250#255); {MAXcontrol Get_Field_Data }
{Refer to MAX_UNIT.PAS for more information on how MaxCommand }
{works, and how remote data is obtained. Certain MAX commands }
{will return data to your program which is then written to a }
{text file on your hard drive, specific to each node number...}
END;
IF FExist('FIELDS.' + IntToStr(DoorSys.Node)) THEN BEGIN
C := 0;
ASSIGN(F,'FIELDS.' + IntToStr(DoorSys.Node));
RESET(F);
WHILE NOT EOF(F) DO BEGIN
INC(C);
READLN(F,St);
St := StripBoth(St,' ');
{The lines of text in the text file will be stored in TDK's }
{Insert# variables which will be converted by CvtVars when }
{the MAXDOOR.INC / FResults_Max procedure is called... }
CASE C OF
1 : Insert1 := St; {Variable holding the name }
2 : Insert2 := St; {Variable holding the password }
3 : Insert3 := St; {Variable holding the birthdate }
4 : Insert4 := St; {Variable holding the voice phone # }
5 : Insert5 := St; {Variable holding the data phone # }
END;
END;
CLOSE(F);
ERASE(F);
Insert2 := AllCaps(Insert2); {Uppercase the password }
FResults_Max; {Display the entry field results / MAXDOOR.INC }
sReadKey;
END;
Ch := #0;
END;
'P' : BEGIN
PDemo_Max; {Internal MAX screen file, see the file MAXDOOR.INC }
DoorSys.UpdateIdle := FALSE; {Stop inactivity checking }
Ch := sReadKey;
DoorSys.UpdateIdle := TRUE; {Restart inactivity checking}
IF Ch = #31 THEN BEGIN {#31 = ALT-S for "Select" }
MaxCommand(''); {Clear The Remote Buffer }
{MaxCommand('Get_Pick_Info()');} {MAXscript Get_Pick_Info }
MaxCommand(#255#126#247#255); {MAXcontrol Get_Pick_Info }
END;
IF FExist('PICKINFO.' + IntToStr(DoorSys.Node)) THEN BEGIN
C := 0;
ASSIGN(F,'PICKINFO.' + IntToStr(DoorSys.Node));
RESET(F);
WHILE NOT EOF(F) DO BEGIN
INC(C);
READLN(F,St);
St := StripBoth(St,' ');
CASE C OF
1 : Insert1 := St; {Variable holding the picklist item # }
2 : Insert2 := St; {Variable holding the picklist text }
END;
END;
CLOSE(F);
ERASE(F);
PResults_Max; {Display the picklist results with MAXDOOR.INC }
sReadKey;
END;
Ch := #0;
END;
'T' : TextPortDemo;
END;
UNTIL Ch = 'Q';
END;
BEGIN
ProgramName := 'MAXDOOR.EXE Version -9.02E+16';
ProgramDesc := 'Example MAX Door Program For TDK And MAX-GUI';
UseAd := FALSE;
InitDoorKit;
MainMenu;
END.